<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge,IE=9,chrome=1"><meta name="generator" content="MATLAB R2019b"><title>Robot Detector</title><style type="text/css">.rtcContent { padding: 30px; } .S0 { margin: 3px 10px 5px 4px; padding: 0px; line-height: 28.8px; min-height: 0px; white-space: pre-wrap; color: rgb(213, 80, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 24px; font-weight: 400; text-align: left;  }
.S1 { margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;  }
.S2 { margin: 3px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(60, 60, 60); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left;  }
.S3 { margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif; font-size: 14px;  }
.S4 { margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap;  }
.CodeBlock { background-color: #F7F7F7; margin: 10px 0 10px 0;}
.S5 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 1px solid rgb(233, 233, 233); border-bottom: 0px none rgb(0, 0, 0); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 16.996px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S6 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 0px none rgb(0, 0, 0); border-bottom: 0px none rgb(0, 0, 0); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 16.996px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S7 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 0px none rgb(0, 0, 0); border-bottom: 1px solid rgb(233, 233, 233); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 16.996px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S8 { color: rgb(64, 64, 64); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 16.996px;  }
.embeddedOutputsErrorElement {min-height: 18px; max-height: 250px; overflow: auto;}
.embeddedOutputsErrorElement.inlineElement {}
.embeddedOutputsErrorElement.rightPaneElement {}
.embeddedOutputsWarningElement{min-height: 18px; max-height: 250px; overflow: auto;}
.embeddedOutputsWarningElement.inlineElement {}
.embeddedOutputsWarningElement.rightPaneElement {}
.diagnosticMessage-wrapper {font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px;}
.diagnosticMessage-wrapper.diagnosticMessage-warningType {color: rgb(255,100,0);}
.diagnosticMessage-wrapper.diagnosticMessage-warningType a {color: rgb(255,100,0); text-decoration: underline;}
.diagnosticMessage-wrapper.diagnosticMessage-errorType {color: rgb(230,0,0);}
.diagnosticMessage-wrapper.diagnosticMessage-errorType a {color: rgb(230,0,0); text-decoration: underline;}
.diagnosticMessage-wrapper .diagnosticMessage-messagePart,.diagnosticMessage-wrapper .diagnosticMessage-causePart {white-space: pre-wrap;}
.diagnosticMessage-wrapper .diagnosticMessage-stackPart {white-space: pre;}
.embeddedOutputsTextElement,.embeddedOutputsVariableStringElement {white-space: pre; word-wrap: initial; min-height: 18px; max-height: 250px; overflow: auto;}
.textElement,.rtcDataTipElement .textElement {padding-top: 3px;}
.embeddedOutputsTextElement.inlineElement,.embeddedOutputsVariableStringElement.inlineElement {}
.inlineElement .textElement {}
.embeddedOutputsTextElement.rightPaneElement,.embeddedOutputsVariableStringElement.rightPaneElement {min-height: 16px;}
.rightPaneElement .textElement {padding-top: 2px; padding-left: 9px;}
.S9 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 1px solid rgb(233, 233, 233); border-bottom: 1px solid rgb(233, 233, 233); border-radius: 0px; padding: 6px 45px 4px 13px; line-height: 16.996px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.variableValue { width: 100% !important; }
.embeddedOutputsMatrixElement,.eoOutputWrapper .matrixElement {min-height: 18px; box-sizing: border-box;}
.embeddedOutputsMatrixElement .matrixElement,.eoOutputWrapper .matrixElement,.rtcDataTipElement .matrixElement {position: relative;}
.matrixElement .variableValue,.rtcDataTipElement .matrixElement .variableValue {white-space: pre; display: inline-block; vertical-align: top; overflow: hidden;}
.embeddedOutputsMatrixElement.inlineElement {}
.embeddedOutputsMatrixElement.inlineElement .topHeaderWrapper {display: none;}
.embeddedOutputsMatrixElement.inlineElement .veTable .body {padding-top: 0 !important; max-height: 100px;}
.inlineElement .matrixElement {max-height: 300px;}
.embeddedOutputsMatrixElement.rightPaneElement {}
.rightPaneElement .matrixElement,.rtcDataTipElement .matrixElement {overflow: hidden; padding-left: 9px;}
.rightPaneElement .matrixElement {margin-bottom: -1px;}
.embeddedOutputsMatrixElement .matrixElement .valueContainer,.eoOutputWrapper .matrixElement .valueContainer,.rtcDataTipElement .matrixElement .valueContainer {white-space: nowrap; margin-bottom: 3px;}
.embeddedOutputsMatrixElement .matrixElement .valueContainer .horizontalEllipsis.hide,.embeddedOutputsMatrixElement .matrixElement .verticalEllipsis.hide,.eoOutputWrapper .matrixElement .valueContainer .horizontalEllipsis.hide,.eoOutputWrapper .matrixElement .verticalEllipsis.hide,.rtcDataTipElement .matrixElement .valueContainer .horizontalEllipsis.hide,.rtcDataTipElement .matrixElement .verticalEllipsis.hide {display: none;}
.embeddedOutputsVariableMatrixElement .matrixElement .valueContainer.hideEllipses .verticalEllipsis, .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer.hideEllipses .horizontalEllipsis {display:none;}
.embeddedOutputsMatrixElement .matrixElement .valueContainer .horizontalEllipsis,.eoOutputWrapper .matrixElement .valueContainer .horizontalEllipsis {margin-bottom: -3px;}
.eoOutputWrapper .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer {cursor: default !important;}
.embeddedOutputsVariableElement {white-space: pre-wrap; word-wrap: break-word; min-height: 18px; max-height: 250px; overflow: auto;}
.variableElement {}
.embeddedOutputsVariableElement.inlineElement {}
.inlineElement .variableElement {}
.embeddedOutputsVariableElement.rightPaneElement {min-height: 16px;}
.rightPaneElement .variableElement {padding-top: 2px; padding-left: 9px;}
.variableNameElement {margin-bottom: 3px; display: inline-block;}
.matrixElement .horizontalEllipsis,.rtcDataTipElement .matrixElement .horizontalEllipsis {display: inline-block; margin-top: 3px; width: 30px; height: 12px; background-repeat: no-repeat; background-image: url("");}
.matrixElement .verticalEllipsis,.textElement .verticalEllipsis,.rtcDataTipElement .matrixElement .verticalEllipsis,.rtcDataTipElement .textElement .verticalEllipsis {margin-left: 35px; width: 12px; height: 30px; background-repeat: no-repeat; background-image: url("");}
.S10 { margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;  }</style></head><body><div class = rtcContent><h1  class = 'S0'><span>Robot Detector</span></h1><div  class = 'S1'><span>Copyright 2018-2019 The MathWorks, Inc.</span></div><h2  class = 'S2'><span>Overview</span></h2><div  class = 'S1'><span>The Robot Detector allows you to simulate vision-based multi-robot detectors for visualization and algorithm prototyping. It includes a MATLAB and Simulink interface.</span></div><div  class = 'S1'><img class = "imageNode" src = "" width = "488" height = "410" alt = "" style = "vertical-align: baseline"></img></div><div  class = 'S1'><span style=' font-weight: bold;'>Properties:</span></div><ul  class = 'S3'><li  class = 'S4'><span style=' font-weight: bold;'>Map: </span><span>A </span><a href = "matlab: doc robotics.OccupancyGrid"><span style=' font-family: monospace;'>robotics.OccupancyGrid</span></a><span> or </span><a href = "matlab: doc robotics.BinaryOccupancyGrid"><span style=' font-family: monospace;'>robotics.BinaryOccupancyGrid</span></a></li><li  class = 'S4'><span style=' font-weight: bold;'>Robot detector offset:</span><span> A 2-by-1 array of </span><span texencoding="[x; y]" style="vertical-align:-5px"><img src="" width="35.5" height="17.5" /></span><span> offset from the vehicle</span></li><li  class = 'S4'><span style=' font-weight: bold;'>Robot detector angle:</span><span> Sensor orientation, in radians, relative to the vehicle </span><span style="font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);">x</span><span>-axis </span></li><li  class = 'S4'><span style=' font-weight: bold;'>Sensor field of view:</span><span> Sensor angular range, in radians, symmetric about the sensor </span><span style="font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);">x</span><span>-axis</span></li><li  class = 'S4'><span style=' font-weight: bold;'>Maximum range:</span><span> The sensor maximum range, in meters.</span></li><li  class = 'S4'><span style=' font-weight: bold;'>Maximum number of detections:</span><span> The maximum robot detections returned. Detections are sorted from nearest to farthest.</span></li><li  class = 'S4'><span style=' font-weight: bold;'>Sample time: </span><span>Sensor sample time (Simulink only)</span></li></ul><div  class = 'S1'><span style=' font-weight: bold;'>Inputs:</span></div><ul  class = 'S3'><li  class = 'S4'><span>None</span></li></ul><div  class = 'S1'><span style=' font-weight: bold;'>Outputs:</span></div><ul  class = 'S3'><li  class = 'S4'><span style=' font-weight: bold;'>Detections: </span><span>A variable-sized array up to size </span><span style=' font-family: monospace;'>maxDetections</span><span>-by-3. Each row corresponds to </span><span style=' font-family: monospace;'>[range,angle,idx]</span><span> of an object detection. Range is in meters, and angle is in radians. The third column is the index of the robot, ranging from 1 to the maximum number of robots in the environment.</span></li></ul><h2  class = 'S2'><span>MATLAB Usage</span></h2><div  class = 'S1'><span>Create a </span><span style=' font-family: monospace;'>MultiRobotEnv</span><span> with a certain number of robots. Then, attach a </span><span style=' font-family: monospace;'>RobotDetector</span><span> object to a specific robot.</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: pre;"><span>numRobots = 10;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: pre;"><span>env = MultiRobotEnv(numRobots);</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: pre;"><span>robotIdx = 5;</span></span></div></div><div class="inlineWrapper outputs"><div  class = 'S7'><span style="white-space: pre;"><span>detector = RobotDetector(env,robotIdx)</span></span></div><div  class = 'S8'><div class="inlineElement eoOutputWrapper embeddedOutputsVariableStringElement" uid="5576C28D" data-testid="output_0" data-width="428" data-height="150" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px;"><div class="textElement"><div><span class="variableNameElement">detector = </span></div><div>  RobotDetector with properties:

         robotIdx: 5
     sensorOffset: [0 0]
      sensorAngle: 0
      fieldOfView: 1.0472
         maxRange: 5
    maxDetections: 3
       sampleTime: 0.1000
</div></div></div></div></div></div><div  class = 'S1'><span>Configure the sensor properties.</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: pre;"><span>load </span><span style="color: rgb(160, 32, 240);">exampleMap</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: pre;"><span>detector.sensorOffset = [0.2 0];</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: pre;"><span>detector.sensorAngle = 0;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: pre;"><span>detector.fieldOfView = pi/2;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: pre;"><span>detector.maxRange = 4;</span></span></div></div><div class="inlineWrapper outputs"><div  class = 'S7'><span style="white-space: pre;"><span>detector.maxDetections = 5</span></span></div><div  class = 'S8'><div class="inlineElement eoOutputWrapper embeddedOutputsVariableStringElement" uid="F1EA199E" data-testid="output_1" data-width="428" data-height="150" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px;"><div class="textElement"><div><span class="variableNameElement">detector = </span></div><div>  RobotDetector with properties:

         robotIdx: 5
     sensorOffset: [0.2000 0]
      sensorAngle: 0
      fieldOfView: 1.5708
         maxRange: 4
    maxDetections: 5
       sampleTime: 0.1000
</div></div></div></div></div></div><div  class = 'S1'><span>Simulate and display the object detections the map and vehicle pose.</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: pre;"><span>rng(21)</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: pre;"><span>robotPoses = 2*rand(3,numRobots);</span></span></div></div><div class="inlineWrapper outputs"><div  class = 'S7'><span style="white-space: pre;"><span>env(1:numRobots,robotPoses);</span></span></div><div  class = 'S8'><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="906DF4A4" data-testid="output_2" style="width: 458px;"><div class="figureElement"><img class="figureImage figureContainingNode" src="" style="width: 560px;"></div></div></div></div><div class="inlineWrapper outputs"><div  class = 'S9'><span style="white-space: pre;"><span>detections = step(detector)</span></span></div><div  class = 'S8'><div class="inlineElement eoOutputWrapper embeddedOutputsVariableMatrixElement" uid="BA8F2D74" data-testid="output_3" data-width="428" style="width: 458px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="matrixElement veSpecifier saveLoad" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="veVariableName variableNameElement double" style="width: 428px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="headerElementClickToInteract" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><span style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">detections = </span><span class="veVariableValueSummary veMetaSummary" style="white-space: normal; font-style: normal; color: rgb(179, 179, 179); font-size: 12px;">4×3</span></div></div><div class="valueContainer" data-layout="{&quot;columnWidth&quot;:66,&quot;totalColumns&quot;:&quot;3&quot;,&quot;totalRows&quot;:&quot;4&quot;,&quot;charsPerColumn&quot;:10}" style="white-space: nowrap; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="variableValue" style="width: 200px; white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">    0.8360    0.3019    3.0000
    1.1686   -0.7808    7.0000
    1.6778   -0.3576    6.0000
    1.7605   -0.3892    9.0000
</div><div class="horizontalEllipsis hide" style="white-space: nowrap; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"></div><div class="verticalEllipsis hide" style="white-space: nowrap; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"></div></div></div></div></div></div></div><div  class = 'S10'><span style=' font-weight: bold;'>Examples</span></div><ul  class = 'S3'><li  class = 'S4'><a href = "matlab:edit mrsSwarmTeams"><span>Multi-robot swarm behavior</span></a></li></ul><h2  class = 'S2'><span>Simulink Usage</span></h2><div  class = 'S1'><span>Use the </span><span style=' font-weight: bold;'>Robot Detector</span><span> block from the </span><span style=' font-weight: bold;'>Environments</span><span> section of the </span><a href = "matlab:mobileRoboticsLib"><span>block library</span></a><span>. </span></div><div  class = 'S1'><img class = "imageNode" src = "" width = "583" height = "309" alt = "" style = "vertical-align: baseline"></img></div><div  class = 'S1'><img class = "imageNode" src = "" width = "739" height = "265" alt = "" style = "vertical-align: baseline"></img></div><div  class = 'S1'><span style=' font-weight: bold;'>Examples</span></div><ul  class = 'S3'><li  class = 'S4'><a href = "matlab:mrsRobotDetectorModel"><span>Robot detector example</span></a></li><li  class = 'S4'><a href = "matlab:mrsMultiRobotAvoidance"><span>Obstacle avoidance example</span></a></li></ul></div>
<br>
<!-- 
##### SOURCE BEGIN #####
%% Robot Detector
% Copyright 2018-2019 The MathWorks, Inc.
%% Overview
% The Robot Detector allows you to simulate vision-based multi-robot detectors 
% for visualization and algorithm prototyping. It includes a MATLAB and Simulink 
% interface.
% 
% 
% 
% *Properties:*
%% 
% * *Map:* A <matlab: doc robotics.OccupancyGrid |robotics.OccupancyGrid|> or 
% <matlab: doc robotics.BinaryOccupancyGrid |robotics.BinaryOccupancyGrid|>
% * *Robot detector offset:* A 2-by-1 array of $[x; y]$ offset from the vehicle
% * *Robot detector angle:* Sensor orientation, in radians, relative to the 
% vehicle $x$-axis 
% * *Sensor field of view:* Sensor angular range, in radians, symmetric about 
% the sensor $x$-axis
% * *Maximum range:* The sensor maximum range, in meters.
% * *Maximum number of detections:* The maximum robot detections returned. Detections 
% are sorted from nearest to farthest.
% * *Sample time:* Sensor sample time (Simulink only)
%% 
% *Inputs:*
%% 
% * None
%% 
% *Outputs:*
%% 
% * *Detections:* A variable-sized array up to size |maxDetections|-by-3. Each 
% row corresponds to |[range,angle,idx]| of an object detection. Range is in meters, 
% and angle is in radians. The third column is the index of the robot, ranging 
% from 1 to the maximum number of robots in the environment.
%% MATLAB Usage
% Create a |MultiRobotEnv| with a certain number of robots. Then, attach a |RobotDetector| 
% object to a specific robot.

numRobots = 10;
env = MultiRobotEnv(numRobots);

robotIdx = 5;
detector = RobotDetector(env,robotIdx)
%% 
% Configure the sensor properties.

load exampleMap
detector.sensorOffset = [0.2 0];
detector.sensorAngle = 0;
detector.fieldOfView = pi/2;
detector.maxRange = 4;
detector.maxDetections = 5
%% 
% Simulate and display the object detections the map and vehicle pose.

rng(21)
robotPoses = 2*rand(3,numRobots);
env(1:numRobots,robotPoses);
detections = step(detector)
%% 
% *Examples*
%% 
% * <matlab:edit mrsSwarmTeams Multi-robot swarm behavior>
%% Simulink Usage
% Use the *Robot Detector* block from the *Environments* section of the <matlab:mobileRoboticsLib 
% block library>. 
% 
% 
% 
% 
% 
% *Examples*
%% 
% * <matlab:mrsRobotDetectorModel Robot detector example>
% * <matlab:mrsMultiRobotAvoidance Obstacle avoidance example>
##### SOURCE END #####
--></body></html>